@import "../../../assets/sass/variables";

.free-radio {
  position: relative;
  display: inline-flex;
  cursor: pointer;
  align-items: center;
  margin-bottom: .5rem;

  .free-radio-inner,
  .free-radio-ins {
    display: flex;
    cursor: pointer;
    align-items: center;
  }

  .free-radio-inner {
    padding-right: 6px;
  }

  >input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    z-index: 10;
  }

  .free-radio-ins,
  .free-radio-ins::after {
    position: relative;
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.26);
    transition: all .4s cubic-bezier(.25,.8,.25,1);
  }

  .free-radio-ins::before,
  .free-radio-ins::after {
    content: '';
    position: absolute;
    top:50%;
    left: 50%;
    background: #fff;
    border-radius: 50%;
  }

  .free-radio-ins::before {
    width: .7rem;
    height: .7rem;
    transform: translate(-50%, -50%);
  }

  .free-radio-ins::after {
    width: .35rem;
    height: .35rem;
    transition: transform .25s;
    transform: translate(-50%, -50%) scale(0);
  }

  >input:checked+.free-radio-inner {
    .free-radio-ins::after,
    .free-radio-ins {
      background: $theme-green;
    }

    .free-radio-ins::after {
      transform: translate(-50%, -50%) scale(1);
    }
  }

  .free-radio-title {
    padding-left: .3rem;
  }

  >input:disabled {
    cursor: not-allowed;
    +.free-radio-ins,
    +.free-radio-ins:after {
      background: rgba(0, 0, 0, 0.15) !important;
    }
  }

  @each $theme, $color in $theme {
    &.free-#{$theme} {
      >input:checked+.free-radio-inner .free-radio-ins {
        &::after {
          background: $color;
        }
        background: $color;
      }
    }
  }
}

